using System;

namespace Ex1Student
{
    public class Person
    {
        private string firstName;
        private string secondName;

        public Person(string firstName, string secondName)
        {
            this.FirstName = firstName;
            this.SecondName = secondName;
        }

        public string FirstName
        {
            get
            {
                return firstName;
            }
            set
            {
                if (value == null || value == string.Empty || value.Length < 5 || value.Length > 60)
                {
                    throw new InvalidPersonExeption("First Name Not valid");
                }
                firstName = value;
            }
        }

        public string SecondName
        {
            get
            {
                return secondName;
            }
            set
            {
                if (value == null || value == string.Empty || value.Length < 5 || value.Length > 60)
                {
                    throw new InvalidPersonExeption("Second Name Not valid");
                }
                secondName = value;
            }
        }
    }

    class InvalidPersonExeption : ApplicationException
    {
        public InvalidPersonExeption(string msg)
            : base(msg)
        {

        }
    }
}